<div class="max-height">
    <div class="input-group tool-bar">
        <button type="button" class="btn btn-default" ng-click="sync()"
                ng-disabled="progress.active()" uib-tooltip="请勿经常同步" uib-tooltip-placement="bottom">
            <span class="fa fa-refresh" ng-class="{'fa-spin': progress.active()}"></span> 同步数据
        </button>
        <button type="button" class="btn btn-default" ng-click="clearMenu()">
            <span class="fa fa-remove"></span> 清空微信菜单
        </button>
        <button type="button" class="btn btn-default" ng-click="create()">
            <span class="fa fa-plus"></span> 添加一级菜单
        </button>
    </div>
    <a-tree-grid name="wxButtonTree" option="options" style="height: calc(100% - 45px);">
    </a-tree-grid>
</div>
<script type="text/ng-template" id="wctMenuDialog">
    <div class="panel panel-default">
        <div class="panel-body">
            <form class="form-horizontal" name="wctMenuForm" ng-submit="submit()">
                <input type="hidden" ng-model="wctMenu.id">
                <input type="hidden" ng-model="wctMenu.ik">
                <!-- <input type="hidden" ng-model="wctMenu.content"> -->
                <input type="hidden" ng-model="wctMenu.update_time">
                <div class="form-group" ng-class="{'has-error': wctMenuForm.name.$error.required}">
                    <label class="col-lg-3 control-label">按钮名称:</label>
                    <div class="col-lg-9">
                        <input type="text" name="name" required class="form-control" ng-model="wctMenu.name" placeholder="按钮名称">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-lg-3 control-label">按钮类型:</label>
                    <div class="col-lg-9">
                        <label class="radio-inline c-radio">
                            <input type="radio" name="type" ng-model="wctMenu.type" value="view">
                            <span class="fa fa-circle"></span>View</label>
                        </label>
                        <label class="radio-inline c-radio">
                            <input type="radio" name="type" ng-model="wctMenu.type" value="click">
                            <span class="fa fa-circle"></span>Click</label>
                        </label>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-lg-3 control-label">按钮链接:</label>
                    <div class="col-lg-9">
                        <input type="text" class="form-control" ng-model="wctMenu.url" ng-readonly="wctMenu.type=='click'" placeholder="按钮链接">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-lg-3 control-label">按钮KEY:</label>
                    <div class="col-lg-9">
                        <input type="text" class="form-control" ng-model="wctMenu.key" ng-readonly="wctMenu.type=='view'" placeholder="按钮KEY">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-lg-3 control-label">按钮图标:</label>
                    <div class="col-lg-9">
                        <input type="text" class="form-control" ng-model="wctMenu.icon" placeholder="按钮图标">
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-lg-offset-9 col-lg-3">
                        <button type="submit" class="btn btn-lg btn-primary" ng-disabled="wctMenuForm.$invalid">确认</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
</script>